package cn.csxw.openchina.ui.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;

import cn.csxw.openchina.R;
import cn.csxw.openchina.base.BaseActivity;
import cn.csxw.openchina.constant.Constant;
import cn.csxw.openchina.entity.bean.TweetBean;
import cn.csxw.openchina.ui.fragment.CommentFragment.MoveCommentFragment;

/**
 * Created by sky on 2017/1/18.
 */

public class MoveCommentActivity extends BaseActivity {

    private int mPosition;
    private TweetBean mTweetBean;

    @Override
    protected void onStart() {
        mActionBar.setTitle("评论详情");
        super.onStart();
    }

    @Override
    public int getLayoutRes() {
        return R.layout.move_comment_activity;
    }

    @Override
    public void initView() {
        //  获取从moveAdapter传递过来的数据
        Intent intent = getIntent();
        mPosition = intent.getIntExtra(Constant.COMMENT_POSITION, 1);
        mTweetBean = (TweetBean) intent.getSerializableExtra(Constant.TWEETBEAN_INFO);

        //  将数据传递给moveCommentFragment
        MoveCommentFragment commentFragment = new MoveCommentFragment();
        Bundle bundle = new Bundle();
        bundle.putInt(Constant.COMMENT_POSITION, mPosition);
        bundle.putSerializable(Constant.TWEETBEAN_INFO, mTweetBean);
        commentFragment.setArguments(bundle);
        getSupportFragmentManager().beginTransaction()
                .replace(R.id.ll_move_comment, commentFragment, Constant.COMMENT_FRAGMENT)
                .commit();
    }

    @Override
    public void initListener() {

    }

    @Override
    public void initData() {

    }

    @Override
    public void onClick(View v, int id) {

    }



}
